package com.caesar;

import java.util.HashMap;
import java.util.Scanner;

/**
 * @author caesar
 * @date 2025/7/18
 * @Description:
 * @apiNote
 */
public class exer1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        HashMap<String, String> map = new HashMap<>();

        System.out.print("请输入小组人数：");
        int count = input.nextInt();

        for (int i = 1; i <= count; i++) {
            System.out.print("请输入学员姓名：");
            String name = input.next();

            System.out.print("请输入手机号码：");
            String tel = input.next();

            map.put(name, tel);
        }
        System.out.println(map);

        System.out.print("请输入你要查询的学员姓名：");
        String findName = input.next();
        String findTel = map.get(findName);
        System.out.println(findName + "的手机号码是" + (findTel != null ? findTel : "不存在"));

        input.close();
    }

}
